import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 寄件货物信息信息 */
export interface ExpressageGoods {
          id: number; // 货物ID
          expressageId?: number; // 寄件ID
          name?: string; // 名称
          unitPrice?: string; // 单价
          num?: number; // 数量
          totalPrice?: string; // 货物总价格
  }

// 寄件货物信息 API
export const ExpressageGoodsApi = {
  // 查询寄件货物信息分页
  getExpressageGoodsPage: async (params: any) => {
    return await request.get({ url: `/business/expressage-goods/page`, params })
  },

  // 查询寄件货物信息详情
  getExpressageGoods: async (id: number) => {
    return await request.get({ url: `/business/expressage-goods/get?id=` + id })
  },

  // 新增寄件货物信息
  createExpressageGoods: async (data: ExpressageGoods) => {
    return await request.post({ url: `/business/expressage-goods/create`, data })
  },

  // 修改寄件货物信息
  updateExpressageGoods: async (data: ExpressageGoods) => {
    return await request.put({ url: `/business/expressage-goods/update`, data })
  },

  // 删除寄件货物信息
  deleteExpressageGoods: async (id: number) => {
    return await request.delete({ url: `/business/expressage-goods/delete?id=` + id })
  },

  /** 批量删除寄件货物信息 */
  deleteExpressageGoodsList: async (ids: number[]) => {
    return await request.delete({ url: `/business/expressage-goods/delete-list?ids=${ids.join(',')}` })
  },

  // 导出寄件货物信息 Excel
  exportExpressageGoods: async (params) => {
    return await request.download({ url: `/business/expressage-goods/export-excel`, params })
  },
}